package com.srd.phone.activity;

import android.annotation.TargetApi;
import android.os.Build;
import android.os.Bundle;
import android.widget.TextView;

import com.shengrongdai.srd.R;
import com.srd.phone.bean.UserInfo;
import com.srd.phone.utils.LogUtils;
import com.srd.phone.utils.UserUtils;

/**
 * 资金管理
 */
public class FundManageActivity extends BaseActivity {

    private TextView tv_count_earnings, tv_wait_earnings, tv_account_all_money,
            tv_may_balance, tv_wait_money, tv_frost_money, tv_wait_all_money;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fund_manage);

        initView();
        initData();
    }

    @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    public void initView() {
        tv_common_title.setText("账户详情");

        tv_count_earnings = (TextView)findViewById(R.id.tv_count_earnings);   // 累积收益
        tv_wait_earnings = (TextView)findViewById(R.id.tv_wait_earnings);   // 待收收益
        tv_account_all_money = (TextView)findViewById(R.id.tv_account_all_money);
        tv_may_balance = (TextView)findViewById(R.id.tv_may_balance);
        tv_wait_money = (TextView)findViewById(R.id.tv_wait_money);
        tv_frost_money = (TextView)findViewById(R.id.tv_frost_money);
        tv_wait_all_money = (TextView)findViewById(R.id.tv_wait_all_money);
    }

    public void initData() {
        UserInfo info = UserUtils.getUserInfo();
        tv_count_earnings.setText(info.sprofit + "元");
        tv_wait_earnings.setText(info.penmoney + "元");
        tv_account_all_money.setText(info.total + "元");
        tv_may_balance.setText(info.available + "元");
        tv_wait_money.setText(info.sumreco + "元");
        tv_frost_money.setText(info.frozenfund + "元");
        tv_wait_all_money.setText(info.frozenfund + "元");
    }

    @Override
    public void returnData(String tag, String data) {
        super.returnData(tag, data);
        LogUtils.i(LoginActivity.class, tag + "   " + data);

    }
}